Skip to content

Conversation

@ldematte
Copy link
Contributor

@ldematte ldematte commented Feb 24, 2025

Our own utility to determine if a path is absolute or relative.
Note that this leads to a conflict, resolved in favor of Unix rules: /foo can be either a Unix absolute path, or a Windows relative path with "wrong" directory separator (using non-canonical slash in Windows).

The code is "copied" (and simplified) from the JDK implementations of UnixPath#isAbsolute and WindowsPathParser#parse

Relates to ES-10912

@ldematte ldematte added >non-issue auto-backport Automatically create backport pull requests when merged v8.18.1 v8.19.0 v9.0.1 v9.1.0 :Core/Infra/Entitlements Entitlements infrastructure labels Feb 24, 2025
@ldematte ldematte requested a review from a team as a code owner February 24, 2025 15:30
@ldematte ldematte requested a review from rjernst February 24, 2025 15:30
@elasticsearchmachine elasticsearchmachine added the Team:Core/Infra Meta label for core/infra team label Feb 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Member

@rjernst rjernst left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, but can you switch the use of isAbsolute in parsing to this?

@ldematte
Copy link
Contributor Author

Looks good, but can you switch the use of isAbsolute in parsing to this?

I was planning to do that in a separate PR but sure, I can do it now

@ldematte ldematte merged commit c7bcdd3 into elastic:main Feb 24, 2025
22 checks passed
@ldematte ldematte deleted the entitlements/absolute-path-check branch February 24, 2025 17:27
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Feb 24, 2025
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Feb 24, 2025
rjernst pushed a commit to rjernst/elasticsearch that referenced this pull request Feb 24, 2025
@ldematte
Copy link
Contributor Author

Auto-backport did not work?
Thanks Ryan for backporting!

9.0 is #123317
8.x is #123318
8.18 is #123319

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

auto-backport Automatically create backport pull requests when merged :Core/Infra/Entitlements Entitlements infrastructure >non-issue Team:Core/Infra Meta label for core/infra team v8.18.1 v8.19.0 v9.0.1 v9.1.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants